package com.gongpingjialoan.activity.main;

import android.os.Bundle;
import android.support.v4.app.FragmentActivity;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentTransaction;
import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;

import com.gongpingjialoan.R;
import com.gongpingjialoan.activity.car.NewRankFragment;

/**
 * Created by Administrator on 2017/8/21.
 */

public class RankActivity extends FragmentActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.rank_activity);
        TextView top_title = (TextView)findViewById(R.id.top_title);
        top_title.setText("榜单");
        ImageView title_back = (ImageView)findViewById(R.id.title_back);
        title_back.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                finish();
            }
        });
        String type = getIntent().getStringExtra("type");
        FragmentManager manager = getSupportFragmentManager();
        FragmentTransaction transaction = manager.beginTransaction();
        NewRankFragment rankFragment = new NewRankFragment();
        Bundle bundle = new Bundle();
        bundle.putString("type",type);
        rankFragment.setArguments(bundle);
        transaction.add(R.id.content, rankFragment);
        transaction.commitAllowingStateLoss();
    }
}
